package com.linz.snake;

import javax.swing.*;
import java.net.URL;

/*
存放外部数据
 */

public class Data {

    //URL：定位图片地址    ImageIcon：图片
    //引用图片地址

    //标题  声明一个公有静态的URL地址类型的变量***，等于图片的路径   Data：类名   getResource：获得资源路径
    public static URL headUrl = Data.class.getResource("/statics/header.png");

    //头方向
    public static URL upUrl = Data.class.getResource("/statics/up.png");
    public static URL downUrl = Data.class.getResource("/statics/down.png");
    public static URL leftUrl = Data.class.getResource("/statics/left.png");
    public static URL rightUrl = Data.class.getResource("/statics/right.png");

    //身体
    public static URL bodyUrl = Data.class.getResource("/statics/body.png");

    //食物
    public static URL foodUrl = Data.class.getResource("/statics/food.png");

    //使用ImageIcon类  使图片地址变为图片
    public static ImageIcon headerImage = new ImageIcon(headUrl);
    public static ImageIcon upImage = new ImageIcon(upUrl);
    public static ImageIcon downImage = new ImageIcon(downUrl);
    public static ImageIcon leftImage = new ImageIcon(leftUrl);
    public static ImageIcon rightImage = new ImageIcon(rightUrl);
    public static ImageIcon foodImage = new ImageIcon(foodUrl);
    public static ImageIcon bodyImage = new ImageIcon(bodyUrl);


}
